package de.tub.bazinga.event;

import java.util.HashSet;
import java.util.Set;

import de.tub.bazinga.eventbus.IEvent;
import de.tub.bazinga.object.Target;
import de.tub.bazinga.player.Player;

public class HitEvent implements IEvent {

	private Player player;
	private Set<Target> hittargets = new HashSet<Target>();

	public HitEvent(Player player, Target hittarget) {
		super();
		this.player = player;
		this.hittargets.add(hittarget);
	}

	public HitEvent(Player player, Set<Target> hitTargets) {
		super();
		this.player = player;
		this.hittargets = hitTargets;
	}

	public int hitTargetCount() {
		return hittargets.size();
	}

	public int targetCount() {
		return player.getTargets().size();
	}

	public boolean allTargetsHit() {
		if (hitTargetCount() == targetCount()) {
			return true;
		}
		return false;
	}

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public Set<Target> getTargets() {
		return hittargets;
	}

	public void setTargets(Set<Target> target) {
		this.hittargets = target;
	}

}
